package com.lightsaber.trade.core.common.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateUtil {
    
    public static String formatYear(int year, String datetimePattern) {
        Calendar now = Calendar.getInstance();
        now.set(Calendar.YEAR, year);
        SimpleDateFormat sdf = new SimpleDateFormat(datetimePattern);
        return sdf.format(now.getTime());
    }
    
    public static void main(String[] args) {
        System.out.println(DateUtil.formatYear(2010, "yy"));
    }
}
